package com.qch.rabbitmq.demo.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

/**
 * @Author qch
 * @Date 2021/5/14
 */
@Component
public class MyMessageListener {
    @RabbitListener(queues = "queue.boot")
    public void getMessega(@Payload String message, @Header(name = "hello")String value){
        System.out.println(message+"hello="+value);
    }
}
